<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Dumping Variables - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.debug.dumping.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.debug.dumping.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.debug.html">Zend_Debug</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.debug.html">Zend_Debug</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.dojo.html">Zend_Dojo</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.debug.dumping" class="section"><div class="info"><h1 class="title">Dumping Variables</h1></div>

    

    <p class="para">
        The static method  <span class="methodname">Zend_Debug::dump()</span> prints or returns
        information about an expression. This simple technique of debugging is
        common because it is easy to use in an ad hoc fashion and requires no
        initialization, special tools, or debugging environment.
    </p>

    <div class="example" id="zend.debug.dumping.example"><div class="info"><p><b>Example #1 Example of dump() method</b></p></div>
        

        <pre class="programlisting brush: php">
Zend_Debug::dump($var, $label = null, $echo = true);
</pre>

    </div>

    <p class="para">
        The <var class="varname">$var</var> argument specifies the expression or variable
        about which the  <span class="methodname">Zend_Debug::dump()</span> method outputs
        information.
    </p>

    <p class="para">
        The <var class="varname">$label</var> argument is a string to be prepended to the
        output of  <span class="methodname">Zend_Debug::dump()</span>. It may be useful, for
        example, to use labels if you are dumping information about multiple
        variables on a given screen.
    </p>

    <p class="para">
        The boolean <var class="varname">$echo</var> argument specifies whether the output
        of  <span class="methodname">Zend_Debug::dump()</span> is echoed or not.
        If <b><tt>TRUE</tt></b>, the output is echoed.
        Regardless of the value of the <var class="varname">$echo</var> argument, the
        return value of this method contains the output.
    </p>

    <p class="para">
        It may be helpful to understand that
         <span class="methodname">Zend_Debug::dump()</span> method wraps the <acronym class="acronym">PHP</acronym> function
        <a href="http://php.net/var_dump" class="link external">&raquo;  <span class="methodname">var_dump()</span></a>.
        If the output stream is detected as a web presentation,
        the output of  <span class="methodname">var_dump()</span> is escaped using <a href="http://php.net/htmlspecialchars" class="link external">&raquo;  <span class="methodname">htmlspecialchars()</span></a>
        and wrapped with (X)HTML <strong class="command">&lt;pre&gt;</strong> tags.
    </p>

    <div class="tip"><b class="tip">Tip</b><div class="info"><h1 class="title">Debugging with Zend_Log</h1></div>
        

        <p class="para">
            Using  <span class="methodname">Zend_Debug::dump()</span> is best for ad hoc
            debugging during software development. You can add code to dump
            a variable and then remove the code very quickly.
        </p>

        <p class="para">
            Also consider the <a href="zend.log.overview.html" class="link">Zend_Log</a>
            component when writing more permanent debugging code. For example,
            you can use the <b><tt>DEBUG</tt></b> log level and the
            <a href="zend.log.writers.html#zend.log.writers.stream" class="link">stream log writer</a> to
            output the string returned by  <span class="methodname">Zend_Debug::dump()</span>.
        </p>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.debug.html">Zend_Debug</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.debug.html">Zend_Debug</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.dojo.html">Zend_Dojo</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="reference.html">Zend Framework Reference</a></li>
  <li class="header up"><a href="zend.debug.html">Zend_Debug</a></li>
  <li class="active"><a href="zend.debug.dumping.html">Dumping Variables</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>